package data

import (
	"core/class"
	"ht/selfreg"
	"reflect"
)

type HtMenuDto struct {
	Id int64 `json:"id,string"                         gorm:"column:id;primaryKey;comment:主键;autoIncrement:false;"`

	Pid        int64  `json:"pid,string"                       gorm:"column:pid;DEFAULT:0;not null;comment:父编号;"`
	HtplatId   int64  `json:"htplatId,string"                    gorm:"column:htplat_id;DEFAULT:0;not null;comment:平台编号;"`
	Code       string `json:"code"         validate:"max=50"   gorm:"column:code;size:50;DEFAULT:'';not null;comment:菜单代码;"`
	Name       string `json:"name"         validate:"required,max=50"gorm:"column:name;size:50;DEFAULT:'';not null;comment:菜单名称;"`
	Lx         string `json:"lx"           validate:"max=10"   gorm:"column:lx;size:10;DEFAULT:'';not null;comment:类型;memo:菜单、页面、权限;"`
	HtpageId   int64  `json:"htpageId,string"                    gorm:"column:htpage_id;DEFAULT:0;not null;comment:页面编号;"`
	HtactionId int64  `json:"htactionId,string"                    gorm:"column:htaction_id;DEFAULT:0;not null;comment:Url编号;"`
	Imgurl     string `json:"imgurl"                           gorm:"column:imgurl;DEFAULT:'';not null;comment:图标;"`
	P1         string `json:"p1"           validate:"max=50"   gorm:"column:p_1;size:50;DEFAULT:'';not null;comment:参数1;"`
	P2         string `json:"p2"           validate:"max=50"   gorm:"column:p_2;size:50;DEFAULT:'';not null;comment:参数2;"`
	P3         string `json:"p3"           validate:"max=50"   gorm:"column:p_3;size:50;DEFAULT:'';not null;comment:参数3;"`
	P4         string `json:"p4"           validate:"max=50"   gorm:"column:p_4;size:50;DEFAULT:'';not null;comment:参数4;"`
	Sortno     int64  `json:"sortno,string"                    gorm:"column:sortno;DEFAULT:0;not null;comment:排序号;"`
	Memo       string `json:"memo"                             gorm:"column:memo;DEFAULT:'';not null;comment:备注;"`
}

func init() {
	var mcls = &HtMenuDto{}
	var m = &class.MyClass{
		Name:     "菜单Dto",
		Ename:    "",
		FullName: "",
		Memo:     "",
		Fileds:   nil,
		PrjName:  "",
		Type:     reflect.TypeOf(mcls),
	}
	selfreg.AddDto(m)
}
